home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-19
/
iritsm3s.zip
/
DAT2IRIT.DSK
(
.txt
)
< prev
next >
Wrap
Turbo C Context File
|
1991-11-11
|
10KB
|
287 lines
Turbo C Context File
DAT2IRIT.C
DAT2IRIT.C
DAT2IRIT.C
DAT2IRIT.C
DAT2IRIT.C
DAT2IRIT.C
DAT2IRIT.C
DAT2IRIT.C
DAT2IRIT.C
DAT2IRIT.C
DAT2IRIT.C
DAT2IRIT.C
DAT2IRIT.C
DAT2IRIT.C
DAT2IRIT.C
DAT2IRIT.C
DAT2IRIT.C
DAT2IRIT.C
ESL1.C
WINDOWS.C
*.CFG
UTAH.C
FONTCNTR.C
FONTCNVT.C
UTAH1.C
..\SM\PROGRAM.H
SHE.C
..\MISC_LIB\*.H
*.DAT
sans.chr
f:*.*
f:tmp
f:temp
solid1.dat
saddle.dat
wiggle.dat saddle.dat
pawn-crv.dat wiggle.dat saddle.dat
pawn-crv.dat wiggle.dat saddle.dat axes.dat points.dat
VertexStruct *.c
float *.c
double *.c
double *.c *.h
void *.c
float *.c *.h
Coord
POINTLIST
double
float
AppPolys
NOGRAPHICS
directory
WasMatch
RealType
FALSE
RealType
AllPolys
SubDir
D:\IRIT\ENGLISH\GANG.C
E:\TEMP\USERINTR.C
E:\TEMP\SHE.H
E:\TEMP\SHE.C
E:\TEMP\REVERSE.C
E:\TEMP\MAKEFILE.TC
E:\TEMP\SHE-PR.C
D:\IRIT\ENGLISH\GANG.C
E:\TEMP\PRINTHEB.C
D:\IRIT\ENGLISH\GANG.C
D:\IRIT\ENGLISH\GANG.C
D:\IRIT\MED\UTAH.C
D:\IRIT\MED\UTAH.C
D:\IRIT\MED\COURSE.C
D:\C\MISC_LIB\IRITPRSR.H
D:\C\IRITFLTR\DAT2IRIT.C
D:\C\IRITFLTR\IRIT2RAY.C
--------------------- CUT HERE -----------------------------------------
VGA.H
*/
typedef struct {
unsigned char red,green,blue;
} p;
#define ESC 0x1B
#define VIDEO_INT 0x10
#define EGA_MODE 0x13
#define TEXT_MODE 0x3
#define VGA640400 0x5E
#define VGA320200 0x13
#define VGA800600 0x58
#ifndef W
extern int W;
extern int RC;
extern int GC;
extern int BC;
extern int H;
extern int XSIZE,YSIZE; /* number of pixels in x and y direction */
extern int MAX_COLOR,NUM_COLORS; /* max color value and maxcolor value +1 */
extern int __current_mode__;
extern p palette[256];
#endif
/* proto types */
void vga_dot(int x, int y, int color);
void vga_mode(int mode);
void text_mode(void);
void set_vga_palette(p *palette);
void set_vga_pal(int index, int red, int green, int blue);
void rainbow_palette(void);
(const void *, const void *)
int(*fcmp)
static void DrawOnePolygon(PolygonStruct *PPolygon)
int i, j, Count, DrawNextEdge, NumOfVertices;
float MappedNormal[3], PolyNormal[3];
VertexStruct
*VList = PPolygon -> PVertex,
*VHead = VList;
if (VList == NULL) return;
TestQuitView();
switch (PPolygon -> Type) {
case POINTLIST:
MyMoveTo(VList -> Coord);
MyDrawTo(VList -> Coord);
VList = VList -> Pnext;
for (i = 0;
i < GlblNumEdges && VList != NULL && VList != VHead;
i++) {
MyMoveTo(VList -> Coord);
MyDrawTo(VList -> Coord);
VList = VList -> Pnext;
}
break;
case POLYLINE:
MyMoveTo(VList -> Coord);
DrawNextEdge = !VList -> Internal;
VList = VList -> Pnext;
for (i = 1;
i < GlblNumEdges && VList != NULL && VList != VHead;
i++) {
if (DrawNextEdge || GlblInternal)
MyDrawTo(VList -> Coord);
else
MyMoveTo(VList -> Coord);
DrawNextEdge = !VList -> Internal;
VList = VList -> Pnext;
}
break;
case POLYGON:
#ifdef __GL__
if (GlblDrawSolid) {
GGMyDrawPolygonSolid(PPolygon);
break;
}
#endif
if (GlblDrawPNormal && PPolygon -> HasPlane) {
/* Sum all points to be averaged for normal position. */
for (i = 0; i < 3; i++) PolyNormal[i] = VList -> Coord[i];
NumOfVertices = 1;
}
MyMoveTo(PList -> Coord);
DrawNextEdge = !PList -> Internal;
VList = VList -> Pnext;
for (i = 1;
i < GlblNumEdges && VList != NULL && VList != VHead;
i++) {
if (DrawNextEdge || GlblInternal)
MyDrawTo(PList[i].Coord);
else
MyMoveTo(PList[i].Coord);
if (GlblDrawVNormal && PList[i].HasNormal) {
for (j = 0; j < 3; j++) MappedNormal[j] =
VList -> Coord[j] + VList -> Normal[j];
j = GlblClosedObject;
GlblClosedObject = FALSE;
MyDrawTo(MappedNormal);
MyMoveTo(VList -> Coord);
GlblClosedObject = j;
if (GlblDrawPNormal && PPolygon -> HasPlane) {
for (j = 0; j < 3; j++) PolyNormal[j] += VList -> Coord[j];
NumOfVertices++;
DrawNextEdge = !VList -> Internal;
VList = VList -> Pnext;
}
if (GlblNumEdges > i) {
/* Close polygon by drawing a line to first vertex. */
if (DrawNextEdge || GlblInternal)
MyDrawTo(VHead -> Coord);
else
MyMoveTo(VHead -> Coord);
if (GlblDrawVNormal && PList[0].HasNormal) {
for (j = 0; j < 3; j++) MappedNormal[j] =
VList -> Coord[j] + VList -> Normal[j];
j = GlblClosedObject;
GlblClosedObject = FALSE;
MyDrawTo(MappedNormal);
MyMoveTo(VList -> Coord);
GlblClosedObject = j;
}
if (GlblDrawPNormal && PPolygon -> HasPlane) {
for (i = 0; i < 3; i++) PolyNormal[i] /= NumOfVertices;
MyMoveTo(PolyNormal);
for (i = 0; i < 3; i++) PolyNormal[i] += PPolygon -> Plane[i];
i = GlblClosedObject;
GlblClosedObject = FALSE;
MyDrawTo(PolyNormal);
GlblClosedObject = i;
}
break;
}
/*****************************************************************************
* Routine to draw one polygon, using global Matrix transform Mat. *
* Note this is the routine that makes the real drawing... *
*****************************************************************************/
static double LastCoord[3]; /* Used to store last point we moved/draw to. */
GGPutMsgXY(InteractMenu.SubWindows[i].Str,
InteractMenu.SubWindows[i].X -
INTERACT_SUB_WINDOW_WIDTH - 0.025,
InteractMenu.SubWindows[i].Y);
#ifdef VoidPtr
#undef VoidPtr
#endif /* VoidPtr */
#ifdef NO_VOID_PTR
#define VoidPtr char *
#else
#define VoidPtr void *
#endif /* NO_VOID_PTR */
#define SIGN(x) ((x) > 0 ? 1 : ((x) < 0 ? -1 : 0))
void VecCrossProd(VectorType Vres, VectorType V1, VectorType V2)
VectorType Vtemp;
Vtemp[0] = V1[1] * V2[2] - V2[1] * V1[2];
Vtemp[1] = V1[2] * V2[0] - V2[2] * V1[0];
Vtemp[2] = V1[0] * V2[1] - V2[0] * V1[1];
VecCopy(Vres, Vtemp);
#ifdef __MSDOS__
typedef float RealType; /* On IBMPC to reserve memory... */
#else
#define DOUBLE
typedef double RealType;
#endif /* __MSDOS__ */
IP_ERR_CAGD_LIB_ERR,
#define CAGD_MESH_UV(Srf, i, j) ((i) + (Srf -> ULength) * (j))
typedef struct CagdSrfStruct {
struct CagdSrfStruct *Pnext;
CagdGeomType GType;
CagdPointType PType;
int ULength, VLength; /* Mesh size in the tensor product surface. */
int UOrder, VOrder; /* Order in tensor product surface (Bspline only). */
CagdRType *Points[CAGD_MAX_PT_SIZE]; /* Pointer on each axis vector. */
CagdRType *UKnotVector, *VKnotVector;
} CagdSrfStruct;
GGScreenErrorCode
;If TRUE (default) generates graphics. Otherwise only generates geometry
; but it can not be displayed.
DoGraphics TRUE
if (!GGDoGraphics) return;
#include "utils.h"
MakeBGIFont
#ifdef VoidPtr
#undef VoidPtr
#endif /* VoidPtr */
#ifdef NO_VOID_PTR
#define VoidPtr char *
#else
#define VoidPtr void *
#endif /* NO_VOID_PTR */
#if !defined(FLOAT) && !defined(DOUBLE)
#ifdef __MSDOS__
#define FLOAT
typedef float RealType; /* On IBMPC to reserve memory... */
#else
#define DOUBLE
typedef double RealType;
#endif /* __MSDOS__ */
#endif /* !FLOAT && !DOUBLE */
#define CR 0x0d
#define LF 0x0a
#define TAB 0x08
*PObjHead = NULL;
static void DumpOneSurface(FILE *f, CagdSrfStruct *Srf)
static void DumpCtlPt(FILE *f, CagdPointType PType, RealType **Points,
/*****************************************************************************
* Routine to convert all surfaces/curves into polylines as follows: *
* Curves are converted to single polyline with SamplesPerCurve samples. *
* Surface are converted into GlblNumOfIsolines curves in each axes, each *
* handled as Curves above. The curves and surfaces are then deleted. *
*****************************************************************************/
IPObjectStruct *IritPrsrProcessFreeForm(IPObjectStruct *CrvObjs,
IPObjectStruct *SrfObjs)
static void DumpOneSurface(FILE *f, char *Name, CagdSrfStruct *Srf)